<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑用户</title>
<!-- 导入jquery核心类库 -->
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/jquery-1.8.3.js"></script>
<!-- 导入easyui类库 -->
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/js/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/js/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/js/easyui/ext/portal.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/css/default.css">	
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/easyui/ext/jquery.portal.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/easyui/ext/jquery.cookie.js"></script>
<script
	src="${pageContext.request.contextPath }/js/easyui/locale/easyui-lang-zh_CN.js"
	type="text/javascript"></script>

</head>
<body class="easyui-layout" style="visibility:hidden;">
	<div region="north" style="height:31px;overflow:hidden;" split="false" border="false" >
		<div class="datagrid-toolbar">
			<a id="save" icon="icon-save" href="#" class="easyui-linkbutton" plain="true" >保存</a>
		</div>
	</div>
	<script type="text/javascript">
	$('#joinDate').datetimebox({   
	    editable:false  
	});
	
	
	$(function(){
		$('#save').click(function(){
			//有效性验证
			if(!$('#form').form('validate')){
				$.messager.alert('提示','表单还未填写完成!');
				return ;
			}
			
			
		$.post("${pageContext.request.contextPath }/admin/member/add.do",$("#form").serialize(), function(data){
			
			if(data.status == 200){
				 //刷新当前页面.
				 $.messager.alert('提示', data.data, 'info', function() {
						$("#memberAddWindow").window('close');
						$("#memberList").datagrid("reload");
				});
			}else{
				
				 //刷新当前页面.
				 $.messager.alert('提示', data.data, 'info', function() {
						$("#memberAddWindow").window('close');
						$("#memberList").datagrid("reload");
				});
				
			}
			
			
		},'json');
		
	});

		
	});
	
</script>
    <div region="center" style="overflow:auto;padding:5px;" border="false">
       <form id="form" method="post">
           <table class="table-edit"  width="70%" align="left">
           		<tr class="title"><td colspan="4">基本信息</td></tr>
	           	<tr>
	           		<td>真实姓名:</td><td><input type="text" name="realname" id="realname" class="easyui-validatebox" required="true" /></td>
					<td>公司名称:</td><td><input type="text" name="companyname" id="companyname" class="easyui-validatebox" required="true"/></td>
				</tr>
				<tr>
					<td>目前职务:</td><td><input type="text" name="job" id="job" class="easyui-validatebox" required="true" /></td>
				</tr>
				<tr>
					<td>身份证号:</td><td><input type="text" name="idcord" id="idcord" class="easyui-validatebox" required="true" /></td>
				</tr>
				<tr>
					<td>密码:</td><td><input type="password" name="pwd" id="pwd" class="easyui-validatebox" required="true" /></td>
				</tr>
				<tr>
					<td>入会形势:</td>
	           		<td>
		           		<select name="jointype" id="jointype" class="easyui-combobox" required="true" style="width: 150px;">
		           			<option value="">请选择</option>
		           			<option value="1">个人</option>
		           			<option value="2">公司</option>
		           		</select>
	           		</td>
	           		<td>用户级别:</td>
	           		<td>
		           		<select name="levelclass" id="levelclass" class="easyui-combobox" required="true" style="width: 150px;">
		           			<option value="1">一般会员</option>
		           			<option value="2">VIP会员</option>
		           			<option value="3">理事会员</option>
		           		</select>
	           		</td>
				</tr>
				
				<tr>
	            <td>入会日期:</td>
	            <td><input id="joinDate" name="joinDate" type="text"  /></td>
	        </tr>
				<tr class="title"><td colspan="4">联系方式</td></tr>
				<tr>
					<td>联系电话</td>
					<td>
						<input type="text" name="mphone" id="mphone" class="easyui-validatebox" required="true" />
					</td>
					<td>电子邮件:</td><td><input type="text" name="email" id="email"/></td>
				</tr>
           </table>
       </form>
	</div>
</body>
</html>